<template>
  <img :src="logoSrc" :class="myClassName" width="160" height="160" style="cursor:pointer" @click="onClick"/>
</template>

<script>
import default_img from '@/assets/image/A01.png'; 
export default {
  name: 'UserAvatar',
  props: {
    src:'',
    className:''
  },
  computed:{
    logoSrc(){
      if(!this.src){
        return default_img;
      }
      return this.src;
    },
    myClassName(){
      if(!this.className){
        return 'useravatar';
      }
      return this.className;
    }
  },
  data() {
    return {
      default_img,
    };
  },
  methods:{
    onClick(){
      this.$emit('click');
    }
  }
};
</script>

<style scoped>

</style>
